<h1><?php echo $title; ?></h1>

<?php if (isset($notice) || $notice = $this->session->flashdata('notification')):?>
<p class="notice"><?php echo $notice;?></p>
<?php endif;?>



<form action="<?php echo site_url('adozioni/anagrafica/assistiti/results') ?>"  method="post" name="searchform" style="display: inline">
			 <?php echo __("Nome:", $module) ?> <input name="filter[nomecognome]" type="text" class="input" value="<?php if(isset($filter['nomecognome'])) echo $filter['nomecognome'] ?>">
			<?php if(isset($filter['liberi'])): ?>
          <input type='hidden' name='filter[liberi]' value="<?php  echo $filter['liberi'] ?>" />
		    <?php else: ?>
			<select name="filter[attivo]">
			<option value="t" <?php if(!isset($filter['attivo']) || $filter['attivo'] == 't') echo " selected " ?>><?php echo __("Tutti", $module) ?></option>
			<option value="s" <?php if($filter['attivo'] == 's') echo " selected " ?>><?php echo __("Attivo", $module) ?></option>
			<option value="n" <?php if($filter['attivo'] == 'n') echo " selected " ?>><?php echo __("Non attivo", $module) ?></option>
			</select>
			<?php endif; ?>

			<?php echo __("Missione:", $module) ?>
			<select name="filter[id_missione]">
				<option value=''><?php echo __("Tutti", $module) ?></option>
				<?php foreach($missioni as $m): ?>
					<option value="<?php echo $m['id'] ?>" <?php if(isset($filter['id_missione']) && $m['id'] == $filter['id_missione']) echo " selected "; ?>><?php echo $m['nome']; ?></option>
				<?php endforeach; ?>
			</select>
			  <input name="Submit2" type="submit" class="forminput" value="Cerca" style="cursor:hand">
			</form>
			<form method='post' name='frmexcel' action="<?php echo site_url('adozioni/anagrafica/assistiti/results') ?>" style="display: inline; ">
			<input type="submit" name="excel" value="<?php echo __("Esporta in Excel", $module) ?>" />
			</form>





<table class="list" border="0" cellpadding="1" cellspacing="1">
  <tr class="titlemedium"> 
	<th width="3">#</th>
	<th height="25%" nowrap class="celeste bold"><?php echo anchor('adozioni/anagrafica/assistiti/order_by/nomecognome',  __("Cognome e Nome", $module)) ?> </th>
	<th width="1%" align="center" class="celeste bold"><?php echo __("Sesso", $module) ?></th>
	<th width="30%" align="center" class="celeste bold"><?php echo anchor('adozioni/anagrafica/assistiti/order_by/m.nome', __("Missione", $module)) ?></th>
	<th width="15%" align="center" class="celeste bold"><?php echo anchor('adozioni/anagrafica/assistiti/order_by/data_nascita', __("Nato", $module)) ?></th>
	<th width="15%" align="center" class="celeste bold"><?php echo anchor('adozioni/anagrafica/assistiti/order_by/data_inserimento', __("Inserito", $module)) ?></th>
	<th width="15%" align="center" class="celeste bold"><?php echo anchor('adozioni/anagrafica/assistiti/order_by/data_modifica', __("Aggiornato", $module)) ?></th>
	<th width="20%" align="center" class="celeste bold"><?php echo __("Azioni", $module) ?></th>
  </tr>
  <?php if($rows): ?> 
  <?php $i=$start+1;foreach($rows as $row): ?>
    <?php if ($i % 2 != 0): $rowClass = 'odd'; else: $rowClass = 'even'; endif;?>
    <tr class="<?php echo $rowClass?>">
	<td><?php echo $i; ?></td>
	<td width="200" height="17" nowrap class="{CLASS} bold"><?php echo anchor('adozioni/anagrafica/assistiti/show/' . $row['id'], $row['nomecognome']) ?></td>
	<td align="center" class="{CLASS}"><strong><?php echo $row['sesso']; ?> </strong></td>
	<td align="center" class="{CLASS}"><?php echo $row['missione']; ?> </td>
	<td align="center" class="{CLASS}"><?php echo data($row['data_nascita']); ?> </td>
	<td align="center" class="{CLASS}"><?php echo data($row['data_inserimento']); ?> </td>
	<td align="center" class="{CLASS}"><?php echo data($row['data_modifica']); ?> </td>
	<td class="{CLASS}"><table width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr align="center">
		  <td><?php echo anchor('adozioni/anagrafica/assistiti/show/' . $row['id'], __("Visualizza", $module)) ?></td>
		  <td><?php echo anchor('adozioni/anagrafica/assistiti/edit/' . $row['id'], __("Modifica", $module)) ?></td>
		  <td><?php echo anchor('adozioni/anagrafica/assistiti/activate/no/' . $row['id'], __("Elimina", $module), array('onClick' => "return confirm('". __("Confermi Eliminazione ?", $module) . "')")) ?></td>
		</tr>
	  </table></td>
  </tr>
  <?php $i++;endforeach; ?>
  <?php endif;?>
</table>
<script>
 document.form1.id_tipo.focus();
</script>
<?php echo $pager; ?>